<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>cocos2dx-JS-OC-Java互相调用 | 小魏的博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
    <meta name="keywords" content="Vker,Vker's Blog">
  
  <meta name="description" content="cocos2dx js java oc 和 js 的相互调用引擎版本: 3.17语言: jsXcode: 10.1AndroidStudio: 3.2.1时间: 2018年12月14日16:23:47  看这篇文章需要 会一些 android java oc ios 的一些知识的基础 不然看着可能有点费劲.  js调用javajs 调用 java java中声名的方法需要是静态方法(static">
<meta name="keywords" content="cocos2d-x">
<meta property="og:type" content="article">
<meta property="og:title" content="cocos2dx-JS-OC-Java互相调用">
<meta property="og:url" content="https://leng521.top/posts/41d43874/index.html">
<meta property="og:site_name" content="小魏的博客">
<meta property="og:description" content="cocos2dx js java oc 和 js 的相互调用引擎版本: 3.17语言: jsXcode: 10.1AndroidStudio: 3.2.1时间: 2018年12月14日16:23:47  看这篇文章需要 会一些 android java oc ios 的一些知识的基础 不然看着可能有点费劲.  js调用javajs 调用 java java中声名的方法需要是静态方法(static">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-08-14T03:22:53.956Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="cocos2dx-JS-OC-Java互相调用">
<meta name="twitter:description" content="cocos2dx js java oc 和 js 的相互调用引擎版本: 3.17语言: jsXcode: 10.1AndroidStudio: 3.2.1时间: 2018年12月14日16:23:47  看这篇文章需要 会一些 android java oc ios 的一些知识的基础 不然看着可能有点费劲.  js调用javajs 调用 java java中声名的方法需要是静态方法(static">
  
  
    <link rel="icon" href="/head.jpg">
  
  <link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css">
  <script src="/js/pace.min.js"></script>
  

  
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?2eaff0c5326867354b0d3469d507d209";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	</script>

  

</head>
</html>
<body>
  <div id="container">
      <header id="header">
    <div id="banner"></div>
    <div id="header-outer">
        <div id="header-menu" class="header-menu-pos animated">
            <div class="header-menu-container">
                <a href="/" class="left">
                    <span class="site-title">Vker&#39;s Blog</span>
                </a>
                <nav id="header-menu-nav" class="right">
                    
                    <a  href="/">
                        <i class="fa fa-home"></i>
                        <span>Home</span>
                    </a>
                    
                    <a  href="/archives">
                        <i class="fa fa-archive"></i>
                        <span>Archives</span>
                    </a>
                    
                    <a  href="/about">
                        <i class="fa fa-user"></i>
                        <span>About</span>
                    </a>
                    
                </nav>
                <a class="mobile-header-menu-button">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
        </div>
        <div id="header-row">
            <div id="logo">
                <a href="/">
                    <img src="/head.jpg" alt="logo">
                </a>
            </div>
            <div class="header-info">
                <div id="header-title">
                    
                    <h2>
                        Vker&#39;s Blog
                    </h2>
                    
                </div>
                <div id="header-description">
                    
                    <h3>
                        一个专注 游戏研发 的技术博客
                    </h3>
                    
                </div>
            </div>
            <nav class="header-nav">
                <div class="social">
                    
                        <a title="Vker" target="_blank" href="//leng521.top">
                            <i class="fa fa-home fa-2x"></i></a>
                    
                        <a title="Github" target="_blank" href="//github.com">
                            <i class="fa fa-github fa-2x"></i></a>
                    
                        <a title="Weibo" target="_blank" href="//weibo.com">
                            <i class="fa fa-weibo fa-2x"></i></a>
                    
                        <a title="Twitter" target="_blank" href="//twitter.com">
                            <i class="fa fa-twitter fa-2x"></i></a>
                    
                </div>
            </nav>
        </div>
    </div>
</header>
      <div class="outer">
        <section id="main" class="body-wrap"><article id="post-cocos2dx-JS-OC-Java互相调用" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
        
  
    <h1 class="post-title" itemprop="name">
      cocos2dx-JS-OC-Java互相调用
    </h1>
    <div class="post-title-bar">
      <ul>
          
              <li>
                  <i class="fa fa-book"></i>
                  
                      <a href="/categories/cocos2d-x/">cocos2d-x</a>
                  
              </li>
          
        <li>
          <i class="fa fa-calendar"></i>  2018-12-15
        </li>
        <li>
          <i class="fa fa-eye"></i>
          <span id="busuanzi_value_page_pv"></span>
        </li>
      </ul>
    </div>
  

          
      </header>
    
    <div class="article-entry post-content" itemprop="articleBody">
      
            
            <h4 id="cocos2dx-js-java-oc-和-js-的相互调用"><a href="#cocos2dx-js-java-oc-和-js-的相互调用" class="headerlink" title="cocos2dx js java oc 和 js 的相互调用"></a>cocos2dx js java oc 和 js 的相互调用</h4><p>引擎版本: 3.17<br>语言: js<br>Xcode: 10.1<br>AndroidStudio: 3.2.1<br>时间: 2018年12月14日16:23:47</p>
<blockquote>
<p>看这篇文章需要 会一些 android java oc ios 的一些知识的基础 不然看着可能有点费劲.</p>
</blockquote>
<h2 id="js调用java"><a href="#js调用java" class="headerlink" title="js调用java"></a>js调用java</h2><p>js 调用 java java中声名的方法需要是静态方法(static method)</p>
<a id="more"></a>
<h5 id="Android-平台下"><a href="#Android-平台下" class="headerlink" title="Android 平台下"></a>Android 平台下</h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(cc.sys.os == cc.sys.OS_ANDROID)&#123;</span><br><span class="line">    jsb.reflection.callStaticMethod(<span class="string">'类名加全路径'</span>,<span class="string">'方法名字'</span>,<span class="string">'方法的签名'</span>,<span class="string">'传递参数'</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">ej: js</span><br><span class="line">    jsb.reflection.callStaticMethod(<span class="string">'org/cocos2dx/javascript/AppActivity'</span>,<span class="string">'getStrVdong'</span>,<span class="string">'(Ljava/lang/String;)V'</span>,<span class="string">'haha'</span>);</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">ej: java</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">getStrVdong</span><span class="params">(String str)</span> </span>&#123;</span><br><span class="line">    log.i(<span class="string">'cocso2dx-js js call java'</span>, str);</span><br><span class="line">&#125;</span><br><span class="line">    </span><br><span class="line">其他方法签名的写法</span><br><span class="line">ej:</span><br><span class="line">    (Ljava/lang/String;)V <span class="comment">//参数是字符串 没有返回值</span></span><br><span class="line">    (I)V <span class="comment">// void(int);</span></span><br><span class="line">    ()V <span class="comment">// void();</span></span><br><span class="line">    (IZ)V <span class="comment">// void(int,boolean);</span></span><br><span class="line">    (IZ)Z <span class="comment">// boolean(int,boolean);</span></span><br><span class="line">    ()Ljava/lang/String; <span class="comment">//String();</span></span><br></pre></td></tr></table></figure>
<h5 id="支持传递的数据类型"><a href="#支持传递的数据类型" class="headerlink" title="支持传递的数据类型"></a>支持传递的数据类型</h5><ul>
<li>Z 布尔</li>
<li>I int</li>
<li>F float</li>
<li>字符串 Ljava/lang/String;</li>
</ul>
<blockquote>
<p>注意这里有个字符串是有个分号的</p>
</blockquote>
<h2 id="java调用js"><a href="#java调用js" class="headerlink" title="java调用js"></a>java调用js</h2><p>java调用js 实际是 将字符串转成 function 然后调用</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* 导入需要的包 */</span></span><br><span class="line"><span class="keyword">import</span> org.cocos2dx.lib.Cocos2dxJavascriptJavaBridge;</span><br><span class="line"><span class="keyword">import</span> org.cocos2dx.lib.Cocos2dxHelper;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">这里需要注意的是调用 js 代码需要运行在 GL 线程中</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">这里实现的逻辑是 将回调的逻辑移交到 js 代码层中, 这样就可以在 js 中 写逻辑 java 在合适的时机去执行这个调用 比如在做支付的时候 需要在之后响应后在 做游戏逻辑的处理.</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title">callFuncVdong</span><span class="params">(<span class="keyword">final</span> String code)</span> </span>&#123;</span><br><span class="line">    Cocos2dxHelper.runOnGLThread(<span class="keyword">new</span> Runnable()&#123;</span><br><span class="line">        <span class="meta">@Override</span></span><br><span class="line">        <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">run</span><span class="params">()</span> </span>&#123;</span><br><span class="line">            Cocos2dxJavascriptJavaBridge.evalString(code);</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">写一下 js 调用的例子</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line">ej:</span><br><span class="line">    jsb.reflection.callStaticMethod(</span><br><span class="line">    <span class="string">"org/cocos2dx/javascript/AppActivity"</span>,</span><br><span class="line">    <span class="string">"callFuncVdong"</span>,</span><br><span class="line">    <span class="string">"(Ljava/lang/String;)V"</span>,</span><br><span class="line">    <span class="string">"g_funcList.callFunc()"</span>); <span class="comment">/*呼叫一个全局函数*/</span></span><br></pre></td></tr></table></figure>
<h4 id="问题记录"><a href="#问题记录" class="headerlink" title="问题记录"></a>问题记录</h4><h5 id="js调用-java-没反应"><a href="#js调用-java-没反应" class="headerlink" title="js调用 java 没反应"></a>js调用 java 没反应</h5><blockquote>
<p>有很大的几率是 js调用中 方法签名没有写正确 你需要检查你的写法 具体的写法上面有写的.</p>
</blockquote>
<hr>
<h2 id="js-调用-oc"><a href="#js-调用-oc" class="headerlink" title="js 调用 oc"></a>js 调用 oc</h2><p>js 调用 oc 其实和 Java的写法是大同小异的</p>
<ul>
<li>在 ios/AppController.h 中声名 静态函数</li>
</ul>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">+(NSString *) showVdong:(NSString *)str title:(NSString *)tit;</span><br></pre></td></tr></table></figure>
<ul>
<li><p>在 ios/AppController.mm 文件中实现</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">@implementation</span><br><span class="line"></span><br><span class="line"><span class="comment">// 在这个之间实现函数</span></span><br><span class="line"></span><br><span class="line">+(NSString *) showVdong:(NSString *)str title:(NSString *)tit &#123;</span><br><span class="line">    <span class="keyword">return</span> @<span class="string">"haha"</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">@end</span><br></pre></td></tr></table></figure>
</li>
<li><p>js 调用用例</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span>(cc.sys.os == cc.sys.OS_IOS || cc.sys.os == cc.sys.OS_OSX) &#123;</span><br><span class="line">    <span class="keyword">var</span> ret = jsb.reflection.callStaticMethod(<span class="string">"AppController"</span>,<span class="string">"showVdong:title"</span>,<span class="string">"你是谁???"</span>,<span class="string">"天呢"</span>);</span><br><span class="line">    cc.log(<span class="string">'****************'</span>,ret);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="oc-调用-js"><a href="#oc-调用-js" class="headerlink" title="oc 调用 js"></a>oc 调用 js</h2><ul>
<li><p>在 ios/AppController.mm 文件中实现</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">"cocos/scripting/js-bindings/manual/ScriptingCore.h"</span></span></span><br><span class="line"></span><br><span class="line">+(NSString *) showVdong:(NSString *)str title:(NSString *)tit &#123;</span><br><span class="line">    </span><br><span class="line">    ScriptingCore::getInstance()-&gt;evalString(<span class="string">"test"</span>);</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> @<span class="string">"haha"</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>js 中的测试用例</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> test = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>&#123;</span><br><span class="line">    cc.log(<span class="string">"OC call JS success !!!"</span>);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<p>参考地址(这个是CocosCreator原生游戏调用) &gt; <a href="https://www.cnblogs.com/billyrun/articles/8529503.html">https://www.cnblogs.com/billyrun/articles/8529503.html</a></p>

            <div class="post-copyright">
    <div class="content">
        <p>最后更新： 2019年08月14日 11:22</p>
        <p>原始链接： <a class="post-url" href="/posts/41d43874/" title="cocos2dx-JS-OC-Java互相调用">https://leng521.top/posts/41d43874/</a></p>
        <footer>
            <a href="https://leng521.top">
                <img src="/head.jpg" alt="小魏">
                小魏
            </a>
        </footer>
    </div>
</div>

      
        
            

        
    </div>
    <footer class="article-footer">
        
        
<div class="post-share">
    <a href="javascript:;" id="share-sub" class="post-share-fab">
        <i class="fa fa-share-alt"></i>
    </a>
    <div class="post-share-list" id="share-list">
        <ul class="share-icons">
          <li>
            <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=https://leng521.top/posts/41d43874/&title=《cocos2dx-JS-OC-Java互相调用》 — 小魏的博客&pic=https://leng521.tophead.jpg" data-title="微博">
              <i class="fa fa-weibo"></i>
            </a>
          </li>
          <li>
            <a class="weixin share-sns" id="wxFab" href="javascript:;" data-title="微信">
              <i class="fa fa-weixin"></i>
            </a>
          </li>
          <li>
            <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=https://leng521.top/posts/41d43874/&title=《cocos2dx-JS-OC-Java互相调用》 — 小魏的博客&source=cocos2dx js java oc 和 js 的相互调用引擎版本: 3.17语言: jsXcode: 10.1AndroidStudio: 3.2.1..." data-title="QQ">
              <i class="fa fa-qq"></i>
            </a>
          </li>
          <li>
            <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://leng521.top/posts/41d43874/" data-title="Facebook">
              <i class="fa fa-facebook"></i>
            </a>
          </li>
          <li>
            <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《cocos2dx-JS-OC-Java互相调用》 — 小魏的博客&url=https://leng521.top/posts/41d43874/&via=https://leng521.top" data-title="Twitter">
              <i class="fa fa-twitter"></i>
            </a>
          </li>
          <li>
            <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=https://leng521.top/posts/41d43874/" data-title="Google+">
              <i class="fa fa-google-plus"></i>
            </a>
          </li>
        </ul>
     </div>
</div>
<div class="post-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;" id="wxShare-close">×</a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>

<div class="mask"></div>

        
        <ul class="article-footer-menu">
            
            
  <li class="article-footer-tags">
    <i class="fa fa-tags"></i>
      
    <a href="/tags/cocos2d-x/" class="color5">cocos2d-x</a>
      
  </li>

        </ul>
        
    </footer>
  </div>
</article>


    <aside class="post-toc-pos post-toc-top" id="post-toc">
        <nav class="post-toc-wrap">
            <ol class="post-toc"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#cocos2dx-js-java-oc-和-js-的相互调用"><span class="post-toc-text">cocos2dx js java oc 和 js 的相互调用</span></a></li></ol></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#js调用java"><span class="post-toc-text">js调用java</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#Android-平台下"><span class="post-toc-text">Android 平台下</span></a></li><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#支持传递的数据类型"><span class="post-toc-text">支持传递的数据类型</span></a></li></ol></li></ol></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#java调用js"><span class="post-toc-text">java调用js</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-4"><a class="post-toc-link" href="#问题记录"><span class="post-toc-text">问题记录</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-5"><a class="post-toc-link" href="#js调用-java-没反应"><span class="post-toc-text">js调用 java 没反应</span></a></li></ol></li></ol></li></ol></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#js-调用-oc"><span class="post-toc-text">js 调用 oc</span></a></li><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#oc-调用-js"><span class="post-toc-text">oc 调用 js</span></a>
        </nav>
    </aside>
    

<nav id="article-nav">
  
    <a href="/posts/79065537/" id="article-nav-newer" class="article-nav-link-wrap">

      <span class="article-nav-title">
        <i class="fa fa-hand-o-left" aria-hidden="true"></i>
        
          scons自动构建工具
        
      </span>
    </a>
  
  
    <a href="/posts/a2412c06/" id="article-nav-older" class="article-nav-link-wrap">
      <span class="article-nav-title">AndroidStudio打包Cocos2dx</span>
      <i class="fa fa-hand-o-right" aria-hidden="true"></i>
    </a>
  
</nav>



    
        <!-- 来必力City版安装代码 -->
<div id="lv-container" data-id="city" data-uid="MTAyMC8zNDA0MC8xMDU3OA==">
<script type="text/javascript">
   (function(d, s) {
       var j, e = d.getElementsByTagName(s)[0];

       if (typeof LivereTower === 'function') { return; }

       j = d.createElement(s);
       j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
       j.async = true;

       e.parentNode.insertBefore(j, e);
   })(document, 'script');
</script>
<noscript>为正常使用来必力评论功能请激活JavaScript</noscript>
</div>
<!-- City版安装代码已完成 -->
    
</section>
        
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info" class="inner">
      
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


      <p>
        Powered by  <a href="http://hexo.io/" target="_blank">Hexo</a>
        Theme <a href="//github.com/wongminho/hexo-theme-miho" target="_blank">MiHo</a>
      &copy; 2019 小魏<br>
      </p>
    </div>
  </div>
</footer>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
  var mihoConfig = {
      root: "https://leng521.top",
      animate: true,
      isHome: false,
      share: true,
      reward: 0
  }
</script>
<div class="sidebar">
    <div id="sidebar-search" title="Search">
        <i class="fa fa-search"></i>
    </div>
    <div id="sidebar-category" title="Categories">
        <i class="fa fa-book"></i>
    </div>
    <div id="sidebar-tag" title="Tags">
        <i class="fa fa-tags"></i>
    </div>
    <div id="sidebar-top">
        <span class="sidebar-top-icon"><i class="fa fa-angle-up"></i></span>
    </div>
</div>
<div class="sidebar-menu-box" id="sidebar-menu-box">
    <div class="sidebar-menu-box-container">
        <div id="sidebar-menu-box-categories">
            <a class="category-link" href="/categories/Cocos-Creator/">Cocos Creator</a><a class="category-link" href="/categories/QQ玩一玩/">QQ玩一玩</a><a class="category-link" href="/categories/cocos2d-x/">cocos2d-x</a><a class="category-link" href="/categories/cocos2dx/">cocos2dx</a><a class="category-link" href="/categories/git/">git</a><a class="category-link" href="/categories/hexo/">hexo</a><a class="category-link" href="/categories/js/">js</a><a class="category-link" href="/categories/linux/">linux</a><a class="category-link" href="/categories/python/">python</a><a class="category-link" href="/categories/前端/">前端</a><a class="category-link" href="/categories/前端/WebGL/">WebGL</a><a class="category-link" href="/categories/前端/bgfx/">bgfx</a><a class="category-link" href="/categories/后端/">后端</a><a class="category-link" href="/categories/后端/golang/">golang</a><a class="category-link" href="/categories/后端/golang/protobuf/">protobuf</a><a class="category-link" href="/categories/后端/nodejs/">nodejs</a><a class="category-link" href="/categories/微信小游戏/">微信小游戏</a><a class="category-link" href="/categories/插件/">插件</a><a class="category-link" href="/categories/自动构建工具/">自动构建工具</a>
        </div>
        <div id="sidebar-menu-box-tags">
            <a href="/tags/9宫格/" style="font-size: 10px;">9宫格</a> <a href="/tags/Cocos-Creator/" style="font-size: 20px;">Cocos Creator</a> <a href="/tags/IT/" style="font-size: 10px;">IT</a> <a href="/tags/QQ玩一玩/" style="font-size: 10px;">QQ玩一玩</a> <a href="/tags/TweenLite/" style="font-size: 10px;">TweenLite</a> <a href="/tags/WebGL/" style="font-size: 10px;">WebGL</a> <a href="/tags/android-studio/" style="font-size: 10px;">android studio</a> <a href="/tags/bgfx/" style="font-size: 12.5px;">bgfx</a> <a href="/tags/c/" style="font-size: 12.5px;">c++</a> <a href="/tags/cocos2d-x/" style="font-size: 15px;">cocos2d-x</a> <a href="/tags/cpp/" style="font-size: 12.5px;">cpp</a> <a href="/tags/gcc/" style="font-size: 10px;">gcc</a> <a href="/tags/git/" style="font-size: 10px;">git</a> <a href="/tags/git-扩展工具/" style="font-size: 10px;">git 扩展工具</a> <a href="/tags/github-page/" style="font-size: 10px;">github page</a> <a href="/tags/git命令/" style="font-size: 10px;">git命令</a> <a href="/tags/golang/" style="font-size: 15px;">golang</a> <a href="/tags/hello-world/" style="font-size: 10px;">hello world</a> <a href="/tags/hexo/" style="font-size: 12.5px;">hexo</a> <a href="/tags/js/" style="font-size: 12.5px;">js</a> <a href="/tags/lua/" style="font-size: 12.5px;">lua</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/optionParser/" style="font-size: 10px;">optionParser</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/python/" style="font-size: 17.5px;">python</a> <a href="/tags/scons/" style="font-size: 12.5px;">scons</a> <a href="/tags/spine/" style="font-size: 10px;">spine</a> <a href="/tags/sublime插件/" style="font-size: 10px;">sublime插件</a> <a href="/tags/websocket/" style="font-size: 10px;">websocket</a> <a href="/tags/xmake/" style="font-size: 12.5px;">xmake</a> <a href="/tags/优化/" style="font-size: 12.5px;">优化</a> <a href="/tags/前端/" style="font-size: 15px;">前端</a> <a href="/tags/博客/" style="font-size: 10px;">博客</a> <a href="/tags/原型链/" style="font-size: 10px;">原型链</a> <a href="/tags/后端/" style="font-size: 10px;">后端</a> <a href="/tags/广告/" style="font-size: 10px;">广告</a> <a href="/tags/微信小游戏/" style="font-size: 20px;">微信小游戏</a> <a href="/tags/缺少dll/" style="font-size: 10px;">缺少dll</a> <a href="/tags/闭包/" style="font-size: 10px;">闭包</a>
        </div>
    </div>
    <a href="javascript:;" class="sidebar-menu-box-close">&times;</a>
</div>
<div class="mobile-header-menu-nav" id="mobile-header-menu-nav">
    <div class="mobile-header-menu-container">
        <span class="title">Menus</span>
        <ul class="mobile-header-menu-navbar">
            
            <li>
                <a  href="/">
                    <i class="fa fa-home"></i><span>Home</span>
                </a>
            </li>
            
            <li>
                <a  href="/archives">
                    <i class="fa fa-archive"></i><span>Archives</span>
                </a>
            </li>
            
            <li>
                <a  href="/about">
                    <i class="fa fa-user"></i><span>About</span>
                </a>
            </li>
            
        </ul>
    </div>
    <div class="mobile-header-tag-container">
        <span class="title">Tags</span>
        <div id="mobile-header-container-tags">
            <a href="/tags/9宫格/" style="font-size: 10px;">9宫格</a> <a href="/tags/Cocos-Creator/" style="font-size: 20px;">Cocos Creator</a> <a href="/tags/IT/" style="font-size: 10px;">IT</a> <a href="/tags/QQ玩一玩/" style="font-size: 10px;">QQ玩一玩</a> <a href="/tags/TweenLite/" style="font-size: 10px;">TweenLite</a> <a href="/tags/WebGL/" style="font-size: 10px;">WebGL</a> <a href="/tags/android-studio/" style="font-size: 10px;">android studio</a> <a href="/tags/bgfx/" style="font-size: 12.5px;">bgfx</a> <a href="/tags/c/" style="font-size: 12.5px;">c++</a> <a href="/tags/cocos2d-x/" style="font-size: 15px;">cocos2d-x</a> <a href="/tags/cpp/" style="font-size: 12.5px;">cpp</a> <a href="/tags/gcc/" style="font-size: 10px;">gcc</a> <a href="/tags/git/" style="font-size: 10px;">git</a> <a href="/tags/git-扩展工具/" style="font-size: 10px;">git 扩展工具</a> <a href="/tags/github-page/" style="font-size: 10px;">github page</a> <a href="/tags/git命令/" style="font-size: 10px;">git命令</a> <a href="/tags/golang/" style="font-size: 15px;">golang</a> <a href="/tags/hello-world/" style="font-size: 10px;">hello world</a> <a href="/tags/hexo/" style="font-size: 12.5px;">hexo</a> <a href="/tags/js/" style="font-size: 12.5px;">js</a> <a href="/tags/lua/" style="font-size: 12.5px;">lua</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/optionParser/" style="font-size: 10px;">optionParser</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/python/" style="font-size: 17.5px;">python</a> <a href="/tags/scons/" style="font-size: 12.5px;">scons</a> <a href="/tags/spine/" style="font-size: 10px;">spine</a> <a href="/tags/sublime插件/" style="font-size: 10px;">sublime插件</a> <a href="/tags/websocket/" style="font-size: 10px;">websocket</a> <a href="/tags/xmake/" style="font-size: 12.5px;">xmake</a> <a href="/tags/优化/" style="font-size: 12.5px;">优化</a> <a href="/tags/前端/" style="font-size: 15px;">前端</a> <a href="/tags/博客/" style="font-size: 10px;">博客</a> <a href="/tags/原型链/" style="font-size: 10px;">原型链</a> <a href="/tags/后端/" style="font-size: 10px;">后端</a> <a href="/tags/广告/" style="font-size: 10px;">广告</a> <a href="/tags/微信小游戏/" style="font-size: 20px;">微信小游戏</a> <a href="/tags/缺少dll/" style="font-size: 10px;">缺少dll</a> <a href="/tags/闭包/" style="font-size: 10px;">闭包</a>
        </div>
    </div>
</div>
<div class="search-wrap">
    <span class="search-close">&times;</span>
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
            <i class="icon icon-lg icon-chevron-left"></i>
        </a>
        <input class="search-field" placeholder="Search..." id="keywords">
        <a id="search-submit" href="javascript:;">
            <i class="fa fa-search"></i>
        </a>
    <div class="search-container" id="search-container">
        <ul class="search-result" id="search-result">
        </ul>
    </div>
</div>

<div id="search-tpl">
    <li class="search-result-item">
        <a href="{url}" class="search-item-li">
            <span class="search-item-li-title" title="{title}">{title}</span>
        </a>
    </li>
</div>
<script src="/js/search.js"></script>
<script src="/js/main.js"></script>


  <script src="//cdn.bootcss.com/particles.js/2.0.0/particles.min.js"></script>
  <div id="particles"></div>
  <script src="/js/particles.js"></script>







  <link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.5.0/animate.min.css">
  <script src="//cdn.bootcss.com/scrollReveal.js/3.0.5/scrollreveal.js"></script>
  <script src="/js/animate.js"></script>


  <script src="/js/pop-img.js"></script>
  <script>
     $(".article-entry p img").popImg();
  </script>

  </div>
</body>
</html>